import request from '@/utils/request'



export function login(data) { //登录
  return request({
    url: '/sys-center/api/login',
    method: 'post',
    data
  })
}

export function logintow(data) { //双因素认证登录
  return request({
    url: '/sys-center/api/system/login/username',
    method: 'post',
    data
  })
}

export function verificationCode() { //验证码
  return request({
    url: '/sys-center/api/login/code',
    method: 'get',
    responseType: 'blob',
  })
}

export function getInfo() {
  return request({
    url: '/sys-center/api/user',
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}


export function getBtn(id) {
  return request({
    url: '/sys-center/api/system/button/power/' + id,
    method: 'get'
  })
}

export function logout() {
  return request({
    url: "/sys-center/api/logout",
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
//切换角色信息
export function roleOver(id) {
  return request({
    url: "/sys-center/api/system/change/role/"+id,
    method: 'get',
  })
}

//修改密码
export function changePassword(data) {
  return request({
    url: "/sys-center/api/system/updatePassword",
    method: 'post',
    data
  })
}


